// app/model/favorite.js
module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const FavoriteSchema = new Schema({
      user: { type: Schema.Types.ObjectId, ref: 'User' },
      article: { type: Schema.Types.ObjectId, ref: 'Article' },
    }, { timestamps: true });

  return mongoose.model('Favorite', FavoriteSchema);
}
